#include <iostream>
using namespace std;

class dataPID {
public:
    double Kp, Ki, Kd;
    double preError, integral;
    dataPID() {
        this->Kp = 0;
        this->Ki = 0;
        this->Kd = 0;
        this->preError = 0;
        this->integral = 0;
    }
};

double calculatePID(dataPID* pidController, double setpoint, double measuredValue) {
    // 注：用指针传值，这样pidController就不是形参，而是引用传值
    double error = setpoint - measuredValue;
    pidController->integral += error;
    double swiftError = error - pidController->preError;
    double output = pidController->Kp * error + pidController->Ki * pidController->integral + pidController->Kd * swiftError;
    pidController->preError = error;
    return output;
}

int main() {
    double setpoint, measuredValue;
    dataPID pidController;
    cin >> pidController.Kp >> pidController.Ki >> pidController.Kd;
    cin >> setpoint >> measuredValue;
    int times; cin >> times;
    for (int i = 1; i <= times; i++) {
        double output = calculatePID(&pidController, setpoint, measuredValue);
        measuredValue += output;
        printf("%d %.6lf\n", i, measuredValue);
    }
}